//###############
//FILE : NameToFileSession.java
//WRITER : Daniel Lowengrub, daniel_i_l, 320687098
//EXERCISE : oop ex3 2011
//DESCRIPTION:
//See below
//###############

package oop.ex3.protocol.sessions;

import java.io.DataOutputStream;
import java.io.IOException;
import oop.ex3.protocol.messages.Message;

/**
 * This is the base class of all sessions that go from a NS to a FM.
 * @author daniel
 */
public abstract class NameToFileSession extends Session {

	/**
	 * Create a new session.
	 * @param initialMessage The intial message of this session.
	 */
    public NameToFileSession(Message initialMessage) {
        super(initialMessage);
    }

    @Override
    protected void cleanup(DataOutputStream outputStream) {
        try {
            _errorMsg.send(outputStream);
        } catch (IOException ex) {
            //ex.printStackTrace();
            //nothing left to do after sending error message
        }
    }

}
